![]() |
PATH![]() |
The USBFindNextInterfaceDescriptorImmediate function returns the address to the next interface descriptor in a specified configuration descriptor.
OSStatus USBFindNextInterfaceDescriptorImmediate(USBPB *pb)
Required fields in the USBPB parameter block for the USBFindNextInterfaceDescriptorImmediate function are
The usbReqCount field should be set to 0 for the first iteration of this call. For each subsequent call to the USBFindNextInterfaceDescriptorImmediate function, usbReqCount contains the offset of the current interface descriptor from the beginning of the configuration descriptor.
The usbBuffer field should be assigned the address of the start of the configuration descriptor obtained from a call to the USBGetFullConfigurationDescriptor function. This must be the full configuration descriptor returned by USBGetFullConfigurationDescriptor . The usbBuffer is assigned a pointer to the next interface descriptor within the specified configuration for each subsequent call to the USBFindNextInterfaceDescriptorImmediate function.
The usbClass , usbSubclass , and usbProtocol fields should contain either specific class, subclass, and protocol numbers, or contain 0 to use for a wildcard search if the caller wants to find an interface regardless of these fields. Upon return, these fields contain the class, subclass, and protocol values for the next interface found. If the caller wants to perform a wildcard search again, the wildcard values must be reset, because these fields are filled in with the returned values from the last call.
Once you've found an interface in the device, you need to find the endpoints that make up that interface.
If no interface is found that matches the requested interface, kUSBNotFound is returned.
The errors returned by the USBFindNextInterfaceDescriptorImmediate function include:
kUSBNotFound
|
interface specified is not in configuration |
kUSBInternalErr, paramErr
|
not a valid configuration descriptor |
Previous | Back Up One Level | Next | Show Frames | Hide Frames